package com.mjk.common.ai.entity;

import com.mjk.common.base.model.BaseEntity;
import com.mjk.common.core.jdbc.annotation.ArcSharding;
import com.mjk.common.core.jdbc.annotation.Filed;
import com.mjk.common.core.jdbc.annotation.Id;
import com.mjk.common.core.jdbc.service.idgenerator.IdGenerateType;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 知识库问答记录实体
 */
@Data
@ArcSharding(dataSource = "pg", table = "adi_knowledge_base_qa")
public class KnowledgeBaseQa extends BaseEntity {

    @Id(type = IdGenerateType.AUTO_UUID)
    private Long id;

    @Filed(cloum = "create_time")
    private LocalDateTime createTime;

    @Filed(cloum = "update_time")
    private LocalDateTime updateTime;

    @Filed(cloum = "is_deleted", comment = "是否删除（0：未删除，1：已删除）")
    private Boolean isDeleted;

    @Id(type = IdGenerateType.AUTO_UUID)
    @Filed(cloum = "uuid", comment = "所属知识库uuid")
    private String uuid;

    @Filed(cloum = "kb_id", comment = "知识库id")
    private Long kbId;

    @Filed(cloum = "kb_uuid", comment = "知识库uuid")
    private String kbUuid;

    @Filed(cloum = "source_file_ids", comment = "来源文档id,以逗号隔开")
    private String sourceFileIds;

    @Filed(cloum = "question", comment = "问题")
    private String question;

    @Filed(cloum = "prompt", comment = "最终提供给LLM的提示词")
    private String prompt;

    @Filed(cloum = "prompt_tokens", comment = "提供给LLM的提示词所消耗的token数量")
    private Integer promptTokens;

    @Filed(cloum = "answer", comment = "答案")
    private String answer;

    @Filed(cloum = "answer_tokens", comment = "答案消耗的token")
    private Integer answerTokens;

    @Filed(cloum = "user_id", comment = "提问用户id")
    private Long userId;

    @Filed(cloum = "ai_model_id", comment = "adi_ai_model id")
    private Long aiModelId;
}
